home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / AdobeExamples / NX_Patterns / PSWsamples.psw < prev    next >
Encoding:
Text File  |  1992-12-19  |  3.9 KB  |  153 lines

  1.  
  2. /*
  3.  * (a)  (C) 1990 by Adobe Systems Incorporated. All rights reserved.
  4.  *
  5.  * (b)  If this Sample Code is distributed as part of the Display PostScript
  6.  *    System Software Development Kit from Adobe Systems Incorporated,
  7.  *    then this copy is designated as Development Software and its use is
  8.  *    subject to the terms of the License Agreement attached to such Kit.
  9.  *
  10.  * (c)  If this Sample Code is distributed independently, then the following
  11.  *    terms apply:
  12.  *
  13.  * (d)  This file may be freely copied and redistributed as long as:
  14.  *    1) Parts (a), (d), (e) and (f) continue to be included in the file,
  15.  *    2) If the file has been modified in any way, a notice of such
  16.  *      modification is conspicuously indicated.
  17.  *
  18.  * (e)  PostScript, Display PostScript, and Adobe are registered trademarks of
  19.  *    Adobe Systems Incorporated.
  20.  * 
  21.  * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
  22.  *    CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
  23.  *    AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
  24.  *    ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
  25.  *    OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
  26.  *    WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
  27.  *    WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
  28.  *    DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
  29.  *    FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
  30.  *    OF THIRD PARTY RIGHTS.
  31.  */
  32.  
  33. /*
  34.  *    PSWsamples.psw
  35.  *
  36.  *    Creator: Carl Orthlieb
  37.  *    CreationDate: 90-11-27
  38.  *    Modified by Ken Fromm
  39.  */
  40.  
  41. defineps PSWPatternOctagon ()
  42.     8 dict begin
  43.         /PatternType 1 def
  44.         /PaintType 2 def
  45.         /TilingType 1 def
  46.         /BBox [ 0 -1 5 5 ] def
  47.         /XStep 4 def
  48.         /YStep 4 def
  49.         /DrawShape {
  50.             0 1 rlineto 1 1 rlineto 1 0 rlineto 1 -1 rlineto 0 -1 rlineto -1 -1 rlineto 
  51.             -1 0 rlineto -1 1 rlineto
  52.         } bind def
  53.         /PaintProc { % dict
  54.             begin
  55.                 0.01 setlinewidth
  56.                 0 0 moveto DrawShape closepath stroke
  57.                 2 2 moveto DrawShape closepath stroke
  58.             end
  59.         } def
  60.         currentdict
  61.     end
  62.     /Octagon exch def 
  63. endps
  64.  
  65. defineps PSWPatternWeave ()
  66.     13 dict begin
  67.         /PatternType 1 def
  68.         /PaintType 1 def
  69.         /TilingType 1 def
  70.         /BBox [ -4 -4 4 4 ] def
  71.         /XStep 5 def
  72.         /YStep 5 def
  73.         /pm [30 cos 30 sin neg 0 1 0 0] 3 -3 matrix scale matrix concatmatrix def
  74.         /im pm matrix invertmatrix def % Transforms user space to pattern space
  75.         /Multi true def
  76.         /PaintColors [ [1] [0] ] def
  77.         /DrawShape { 
  78.             1 2 moveto 2 2 rlineto -2 0 rlineto closepath fill % Right "ear"
  79.             -1 1 moveto 0 2 rlineto -2 -2 rlineto closepath fill % Left "ear"
  80.             1 1 moveto
  81.             0 3 rlineto -1 0 rlineto -1 -1 rlineto 0 -3 rlineto
  82.             -3 -3 rlineto 0 -1 rlineto 1 0 rlineto 3 3 rlineto
  83.             3 0 rlineto 1 1 rlineto 0 1 rlineto closepath
  84.         } bind def
  85.         /PaintData [ { fill } bind { im concat stroke } bind ] def
  86.         /PaintProc { % data dict
  87.             begin 
  88.                 DrawShape exec
  89.             end
  90.         } def
  91.         currentdict
  92.     end
  93.     /Weave exch def
  94. endps
  95.  
  96. defineps PSWPatternCircleStar ()
  97.     10 dict begin
  98.         /PatternType 1 def
  99.         /PaintType 1 def
  100.         /TilingType 1 def
  101.         /BBox [ -12 -12 12 12 ] def
  102.         /XStep 24 def
  103.         /YStep 24 def
  104.         /Multi true def
  105.         /PaintColors [ [ 1 0 0 ] [ 0 1 0 ] [ 0 0 1 ] ] def
  106.         /PaintData [ 
  107.             { -12 -12 moveto 0 24 rlineto 24 0 rlineto 0 -24 rlineto closepath } bind
  108.             { 12 0 moveto 0 0 12 0 360 arc closepath } bind
  109.             { 0 12 moveto 4 { 144 rotate 0 12 lineto } repeat closepath } bind
  110.         ] def
  111.         /PaintProc { % data dict
  112.             begin
  113.                 exec fill
  114.             end
  115.         } def
  116.         currentdict
  117.     end
  118.     /CircleStar exch def
  119. endps
  120.  
  121. defineps PSWPatternBrick ()
  122.     11 dict begin
  123.         /PaintType 1 def
  124.         /PatternType 1 def
  125.         /TilingType 1 def
  126.         /BBox [ 0 0 1 1 ] def
  127.         /XStep 1 def
  128.         /YStep 1 def
  129.         /Multi true def
  130.         /Bitmap <        
  131.             FFFFFF
  132.             808080
  133.             808080
  134.             808080
  135.             FFFFFF
  136.             080808
  137.             080808
  138.             080808
  139.         > def
  140.         /PaintColors [ [1 0 0] [0 1 0] ] def
  141.         /PaintData [ { 0 0 moveto 0 1 rlineto 1 0 rlineto  0 -1 rlineto closepath eofill }
  142.              { 24 24 true [24 0 0 -24 0 24] { Bitmap } imagemask } 
  143.         ] def
  144.         /PaintProc { % data dict
  145.             begin
  146.                 exec
  147.             end
  148.         } bind def
  149.         currentdict
  150.     end
  151.     /Brick exch def
  152. endps
  153.